<?php
namespace app\admin\template;

class war_user {

    public function init($war_id='')
    {
        switch ($war_id) {
            case '1':
                return [
                    'user_type'       => ['title'=>'账号类型','template' => $this->user_type_plat],
                    'user_id'         => ['title'=>'渠道或通道ID','template' => $this->user_id],
                    'isp_host'        => ['title'=>'监控类型','template' => $this->isp_host],
                    'fail_percent'    => ['title'=>'失败占比','template' => $this->fail_percent],
                    'unknown_percent' => ['title'=>'未知占比','template' => $this->unknown_percent],
                    'onoff'           => ['title'=>'配置开关','template' => $this->onoff],
                    
                ];
                break;
            case '3':
                return [
                    'user_type'     => ['title'=>'账号类型','template' => $this->user_type_channel],
                    'user_id'       => ['title'=>'渠道或通道ID','template' => $this->user_id],
                    'isp_host'      => ['title'=>'监控类型','template' => $this->isp_host],
                    'war_sms_limit' => ['title'=>'短信上限','template' => $this->war_sms_limit],
                    'type'          => ['title'=>'监控类型','template' => $this->type],
                    'amt'           => ['title'=>'监控余额','template' => $this->amt],
                    'sms_amt'       => ['title'=>'监控条数','template' => $this->sms_amt],
                    'sms_ctn'       => ['title'=>'短信内容','template' => $this->sms_ctn],
                    'sms_phone'     => ['title'=>'接收号码','template' => $this->sms_phone],
                    'onoff'           => ['title'=>'配置开关','template' => $this->onoff],

                ];
                break;
            case '10':
                return [
                    'user_type'     => ['title'=>'账号类型','template' => $this->user_type_channel],
                    'user_id'       => ['title'=>'渠道或通道ID','template' => $this->user_id],
                    'war_sms_limit' => ['title'=>'短信上限','template' => $this->war_sms_limit],
                    'deal_time'          => ['title'=>'处理时间','template' => $this->deal_time],
                    'onoff'           => ['title'=>'配置开关','template' => $this->onoff],
                ];
                break;
            
            default:
                return [
                    'user_type'       => ['title'=>'账号类型','template' => $this->user_type_channel],
                    'user_id'         => ['title'=>'渠道或通道ID','template' => $this->user_id],
                    'isp_host'        => ['title'=>'监控类型','template' => $this->isp_host],
                    'fail_percent'    => ['title'=>'失败占比','template' => $this->fail_percent],
                    'unknown_percent' => ['title'=>'未知占比','template' => $this->unknown_percent],
                    'onoff'           => ['title'=>'配置开关','template' => $this->onoff],
                    
                ];
                break;
        }
    }
	public $user_type_plat = '<div class="layui-row">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="custom-color-red">*</span>账号类型：</label>
            <div class="layui-input-block">
                <select name="user_type" lay-search lay-verify="required">
                    <option value="PLAT">通道</option>
                </select>
            </div>
        </div>
    </div>';

    public $user_type_channel = '<div class="layui-row">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="custom-color-red">*</span>账号类型：</label>
            <div class="layui-input-block">
                <select name="user_type" lay-search lay-verify="required">
                    <option value="CHANNEL">渠道</option>
                </select>
            </div>
        </div>
    </div>';
    public $user_id = '<div class="layui-row">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="custom-color-red">*</span> 渠道或通道ID：</label>
            <div class="layui-input-block">
                <input type="text" name="user_id" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>
    </div>';
    public $isp_host = '<div class="layui-row">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="custom-color-red">*</span>监控类型：</label>
            <div class="layui-input-block">
                <select name="isp_host" lay-search lay-verify="required">
                    <option value=""></option>
                    <option value="10086">移动</option>
                    <option value="10010">联通</option>
                    <option value="10000">电信</option>
                    <option value="90001">三网</option>
                </select>
            </div>
        </div>
    </div>';
    public $war_sms_limit = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 短信上限：</label>
                <div class="layui-input-block">
                    <input type="text" name="war_sms_limit" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                    <p>预警短信上限</p>
                </div>
            </div>
        </div>';
    public $type = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span>监控类型：</label>
                <div class="layui-input-block">
                    <select name="type" lay-search lay-verify="required" lay-filter="type">
                        <option value=""></option>
                        <option value="0">监控余额</option>
                        <option value="1">监控条数</option>
                    </select>
                </div>
            </div>
        </div>';

    public $amt = '<div class="layui-row layui-hide amt">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 监控余额：</label>
                <div class="layui-input-block">
                    <input type="text" name="amt" value="" placeholder="请输入" autocomplete="off" class="layui-input" >
                    <p>余额</p>
                </div>
            </div>
        </div>'; 
    public $sms_amt = '<div class="layui-row layui-hide sms_amt">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 监控条数：</label>
                <div class="layui-input-block">
                    <input type="text" name="sms_amt" value="" placeholder="请输入" autocomplete="off" class="layui-input" >
                    <p>监控条数</p>
                </div>
            </div>
        </div>'; 
    public $sms_ctn = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 短信内容：</label>
                <div class="layui-input-block">
                    <input type="text" name="sms_ctn" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                    <p>预警短信内容</p>
                </div>
            </div>
        </div>'; 
    public $sms_phone = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 接收号码：</label>
                <div class="layui-input-block">
                    <input type="text" name="sms_phone" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                    <p>预警短信接收号码，多个用英文逗号隔开</p>
                </div>
            </div>
        </div>'; 
    public $deal_time = '<div class="layui-row">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="custom-color-red">*</span> 处理时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="deal_time" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                        <p>处理时间（单位：分钟）</p>
                    </div>
                </div>
            </div>'; 
    public $fail_percent = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 失败占比：</label>
                <div class="layui-input-block">
                    <input type="text" name="fail_percent" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                    <p>失败预警占比；如：0.1 </p>
                </div>
            </div>
        </div>'; 
    public $unknown_percent = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span> 未知占比：</label>
                <div class="layui-input-block">
                    <input type="text" name="unknown_percent" value="" placeholder="请输入" autocomplete="off" class="layui-input" lay-verify="required">
                    <p>未知预警占比；如：0.1</p>
                </div>
            </div>
        </div>'; 
    public $onoff = '<div class="layui-row">
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="custom-color-red">*</span>配置开关：</label>
                <div class="layui-input-block">
                    <select name="onoff" lay-search lay-verify="required">
                        <option value=""></option>
                        <option value="1">开启</option>
                        <option value="0">禁用</option>
                    </select>
                </div>
            </div>
        </div>'; 
}